/*-
 *  Copyright (C) 2009 Peter Baldwin   
 *  
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.peterbaldwin.client.android.sms2email;

import android.app.PendingIntent;
import android.os.Build;

public abstract class SmsManager {
	public static final int RESULT_ERROR_RADIO_OFF = 2;
	public static final int RESULT_ERROR_NO_SERVICE = 4;

	private static final int SDK_VERSION = Integer.parseInt(Build.VERSION.SDK);
	private static final int DONUT = 4;

	public static SmsManager getDefault() {
		if (SDK_VERSION >= DONUT) {
			return new StandardSmsManager();
		} else {
			return new LegacySmsManager();
		}
	}

	public abstract void sendTextMessage(String destinationAddress,
			String scAddress, String text, PendingIntent sentIntent,
			PendingIntent deliveryIntent);
}
